package com.asura.ops.sync.sdk;

import com.asura.ops.sync.api.model.CfgClientDto;
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: zouyang
 * @date: 2022/8/3
 * @description: 客户端配置缓存
 */
public class ClientConfigCache {

    private static CfgClientDto cfgClientDto;

    private static List<SimpleMessageListenerContainer> listenerContainers = new ArrayList<>();

    public static CfgClientDto getCfgClientDto() {
        return cfgClientDto;
    }

    public static void setCfgClientDto(CfgClientDto cfgClientDto) {
        synchronized (cfgClientDto) {
            ClientConfigCache.cfgClientDto = cfgClientDto;
        }
    }

    public static List<SimpleMessageListenerContainer> getListenerContainers() {
        return listenerContainers;
    }

    public static void setListenerContainers(List<SimpleMessageListenerContainer> listenerContainers) {
        ClientConfigCache.listenerContainers = listenerContainers;
    }
}
